package ch.exm.storm.functional.matcher;

import static ch.exm.storm.functional.matcher.CoreMatchers.equalTo;

public class IsNot implements Matcher {
    private final Matcher matcher;

    public IsNot(Matcher matcher) {
        this.matcher = matcher;
    }

    public boolean matches(Object arg) {
        return !matcher.matches(arg);
    }

    public static Matcher not(Matcher matcher) {
        return new IsNot(matcher);
    }

    public static Matcher not(Object value) {
        return not(equalTo(value));
    }
}
